<?php
/**
 * Created by PhpStorm.
 * User: lixy
 * Date: 2016/1/21
 * Time: 10:10
 */

namespace app\models;

use app\lib\BaseModel;

class ActivityDao extends BaseModel
{
/*PROCEDURE P_WXMAL_ACTIVITY
(
USERID IN VARCHAR2              --用户id
, ACTIONID IN VARCHAR2            --活动id
, RESULTS OUT VARCHAR2            --返回值
)
1表示成功，其它为错误信息*/
    //oracle存储过程
    //接收卡片   成功返回1  失败返回 汉字
    public static function P_WXMAL_ACTIVITY($ACTIONID,$USERID){

        $cmd=  static::query()->createCommand('call P_WXMAL_ACTIVITY( :USERID,:ACTIONID,:RESULTS)');
        $cmd->bindValue(':USERID',$USERID);

        $cmd->bindValue(':ACTIONID',$ACTIONID);
        $cmd->bindParam(':RESULTS', $re,\PDO::PARAM_STR,50);
        $cmd->execute();

        return $re;
    }
}